package com.osgi.desktop.ui.util;

import javax.swing.JOptionPane;

public class SwingUtil {
        
    private static void displayMessage(String message, String header, int dialogType) {
       JOptionPane.showMessageDialog(null, message, header, dialogType);
    }

    public static void displayWarning(String message) {
        displayMessage(message, "WARNING", JOptionPane.WARNING_MESSAGE);
    }

    public static void displayError(String message) {
        displayMessage(message, "ERROR", JOptionPane.ERROR_MESSAGE);
    }

    public static void displayInformation(String message) {
        displayMessage(message, "INFORMATION", JOptionPane.INFORMATION_MESSAGE);
    }
    
    public static boolean questionYesNo(String message) {
        Object[] opB1 = {"YES", "NO"};
        return JOptionPane.YES_OPTION == JOptionPane.showOptionDialog(null, message,
                        "QUESTION", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,opB1,opB1[0]);
    }
    
}
